package cn.rslee.uaas.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import cn.rslee.uaas.entity.AccessHour;
import cn.rslee.uaas.repository.AccessHourRepository;
import cn.rslee.uaas.util.U;

@Component("accessHourService")
public class AccessHourServiceImpl implements AccessHourService {

	@Resource
	private AccessHourRepository accessHourRepository;
	
	@Override
	public List<AccessHour> findAll() {
		return accessHourRepository.findAll();
	}

	@Override
	public AccessHour get(long id) {
		return accessHourRepository.findOne(id);
	}

	@Override
	public List<AccessHour> findByDay(String day,String sysCode ) {
		return accessHourRepository.findByDaysAndSysCode(U.toDate(day),sysCode);
	}

}
